<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../tpl/head.jsp"%>

<!------------------------------------- 页面介绍： 组织机构-------------------------------->
<div  id="LAY_app" class="layui-fluid">
    
    <div class="layui-card">
        <div class="layui-card-header layui-bg-cyan">
            <span  >权限中心 > 组织机构</span>
        </div>
        <div class="layui-card-body">
            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <li class="layui-this"><i class="layui-icon layui-icon-set"></i> 公司设置</li>
                    <li><i class="layui-icon layui-icon-tabs"></i> 新增公司</li>
                    <li><i class="layui-icon layui-icon-tabs"></i> 新增部门</li>
                    <li><i class="layui-icon layui-icon-list"></i> 新增子部门</li>

                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <!-- 公司设置 -->
                        <div class="layui-card border-left">
                           
                            <div class="layui-card-body">
                                <dl class="layui-row layui-col-space15">
                                    <dd class="layui-col-md3">
                                        <ul id="tree-demo" ></ul>
                                    </dd>
                                    <dd class="layui-col-md9 border-left" v-show="page.flag>0">
                                        <div class="layui-nav"  v-if="page.treenode">
                                            <span class="layui-nav-item" v-text="page.treenode.name"></span>
                                        </div>
                                      <ul class="layui-list padding">
                                          <li v-show="page.flag==1">
                                            <form action="" class="layui-form" >
                                                <table class="layui-table" lay-skin="nob">
                                        
                                                    <tr>
                                                        <td align="right"><b>公司名称</b> </td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">英文名称</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right"><strong>简称</strong></td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">地址</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">英文地址</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">邮编</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">海关号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">税务登记号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">FormA号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">地证注册号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">法人</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">邮件地址</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">电话</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">传真</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">主页</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">登记号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">公司性质</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                        <td align="right">经营范围</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">中文LOGO</td>
                                                        <td>
                                                            <label>
                                                                  <input type="file" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input"><i class="layui-icon layui-icon-picture float-left"></i>
                                                            </label>
                                                          
                                                        </td>
                                                        <td  align="right">英文LOGO</td>
                                                        <td>
                                                            <input type="file" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input"><i class="layui-icon layui-icon-picture"></i>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td  align="right">是否代理</td>
                                                        <td>
                                                            <input type="checkbox" name="" title="代理">
                                                        </td>
                                                        <td align="right">保险单号</td>
                                                        <td>
                                                            <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                                        </td>
                                                    </tr>
                                            <tr>
                                                <td colspan="4" align="center">
                                                    <button class="layui-btn" lay-submit=""
                                                    lay-filter="component-form-element">立即提交</button>
                                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                                </td>
                                            </tr>
                                                     
                                            
                                                </table>
                                            </form>
                                           
                                          </li>
                                          <li v-show="page.flag==2">
                                                <form action="" class="layui-form">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">名称</label>
                                                        <div class="layui-input-block">
                                                          <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                                                        </div>
                                                      </div>
                                                      <div class="layui-form-item">
                                                        <label class="layui-form-label">代码</label>
                                                        <div class="layui-input-block">
                                                          <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                                                        </div>
                                                      </div>
                                                      <div class="layui-form-item layui-form-text">
                                                        <label class="layui-form-label">备注</label>
                                                        <div class="layui-input-block">
                                                          <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                                                        </div>
                                                      </div>

                                                      <div class="layui-form-item">
                                                        <div class="layui-input-block">
                                                          <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                                          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                                        </div>
                                                      </div>
                                                </form>
                                          </li>
                                      </ul>
                                    </dd>
                
                                </dl>
                            </div>
                        </div>

                    </div>
                    <div class="layui-tab-item">
                        <!-- 新增公司 -->
                        <%@ include file="tplnewcompany.jsp"%>
                       
                       
                    </div>
                    <div class="layui-tab-item">
                        <!--   内容2 -->
                        <form class="layui-form" action="">
                            
                            <div class="layui-form-item">
                                <div class=" layui-row layui-col-space10">
                                    <div class="layui-col-md6">
                                        <label class="layui-form-label">名称</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="" required lay-verify="required" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-md6">
                                        <label class="layui-form-label">公司</label>
                                        <div class="layui-input-block">
                                          <select name="city" lay-verify="required">
                                            <option value=""></option>
                                            <option value="0">北京</option>
                                            <option value="1">上海</option>
                                            <option value="2">广州</option>
                                            <option value="3">深圳</option>
                                            <option value="4">杭州</option>
                                          </select>
                                        </div>
                                      </div>
                                </div>
                                
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">代码</label>
                                <div class="layui-input-block">
                                    <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">备注</label>
                                <div class="layui-input-block">
                                    <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit=""
                                        lay-filter="component-form-element">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </form>

                    </div>
                    <div class="layui-tab-item">
                        <!-- 内容3 -->
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <div class=" layui-row layui-col-space10">
                                    <div class="layui-col-md6">
                                        <label class="layui-form-label">公司</label>
                                        <div class="layui-input-block">
                                            <select name=" " lay-verify="required">
                                                <option value=""></option>
                                                <option value="0">北京</option>
                                                <option value="1">上海</option>
                                                <option value="2">广州</option>
                                                <option value="3">深圳</option>
                                                <option value="4">杭州</option>
                                              </select>
                                        </div>
                                    </div>
                                    <div class="layui-col-md6">
                                        <label class="layui-form-label">部门</label>
                                        <div class="layui-input-block">
                                          <select name=" " lay-verify="required">
                                            <option value=""></option>
                                            <option value="0">北京</option>
                                            <option value="1">上海</option>
                                            <option value="2">广州</option>
                                            <option value="3">深圳</option>
                                            <option value="4">杭州</option>
                                          </select>
                                        </div>
                                      </div>
                                </div>
                                
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">子部门名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">代码</label>
                                <div class="layui-input-block">
                                    <input type="text" name="" required lay-verify="required" autocomplete="off"
                                        class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">备注</label>
                                <div class="layui-input-block">
                                    <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit=""
                                        lay-filter="component-form-element">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>

                </div>
            </div>
        </div>
    </div>
   
</div>
<style>
   
</style>

<script src="/statics/modules/vstore.js"></script>
<script>
 layui.tree({
            elem: '#tree-demo' //传入元素选择器
            , nodes: [ //节点
                 {
                    name: '公司设置'
                    , id: 1
                    , flag:0
                    , spread: true
                    , children: [
                        {
                            name: '公司1'
                            , id: 21
                            ,flag:1
                            , spread: false
                            , children: [
                                {
                                    name: '子部门1'
                                    , id: 211
                                    ,flag:2
                                }, {
                                    name: '子部门2'
                                    , id: 212
                                    ,flag:2
                                }, {
                                    name: '子部门3'
                                    , id: 213
                                    ,flag:2
                                }
                            ]
                        }, {
                            name: '公司2'
                            , id: 22
                            ,flag:1
                            , children: [
                                {
                                    name: '子部门a'
                                    , id: 221
                                    ,flag:2
                                }, {
                                    name: '子部门b'
                                    , id: 222
                                    ,flag:2
                                }, {
                                    name: '子部门c'
                                    , id: 223
                                    ,flag:2
                                }
                            ]
                        }
                    ]
                }
            ]   
            , click: function (node) {
                console.log(node) //node即为当前点击的节点数据
               
               Vue.set(vm.page, "treenode", node);
                    Vue.set(vm.page, "flag", node.flag);     
                
            }      
        });
 


</script>
<%@ include file="../tpl/foot.jsp"%>